﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace SmartMD.DataModel.Entity
{
    /** 
 * <p>类说明:标本</p>
 * @version 1.0
 * <p>文件名： </p>
 * <p>创建人及时间： xiangyuliang 2011-8-27</p>
 * <p>修改人：</p>
 * <p>修改时间：</p>
 * <p>修改描述：</p>
 **/

    public class SpecInfo : BusinessEntity
    {
        private string _patientId;    //病人标识
        private ObservableCollection<SiteSelectEntity> _siteEntityList;     //位置编码
        private string _collecter;       //随访人
        private DateTime _followUpDate;   //随访时间
        private int _followUpTimes;  //随访周次
     
        private string _specType;     //标本类型
        private string _specification; //标本规格 
        public int SpecNum;  //标本数
        private string _subject;    //所属课题
       // private int _freezeThrawTimes;  //冻融次数
        private int _maxFreezeThrawTimes; //最大冻融次数
        private string _specSource;  //源标本标识

        public int FollowUpTimes
        {
            get
            {
                return _followUpTimes;
            }
            set
            {
                _followUpTimes = value;
                OnPropertyChanged(() => FollowUpTimes);
            }
        }

       /* public int SpecNum
        {
            get
            {
                return _specNum;
            }
            set
            {
                _specNum = value;
                OnPropertyChanged(() => SpecNum);
            }
        }  */
        public String Specification
        {
            get
            {
                return _specification;
            }
            set
            {
                _specification = value;
                OnPropertyChanged(() => Specification);
            }
        }
        public String Subject
        {
            get
            {
                return _subject;
            }
            set
            {
                _subject = value;
                OnPropertyChanged(() => Subject);
            }
        }
      

        [CheckValue("标本定义“病人标识”不能为空")]
        public String PatientId
        {
            get
            {
                return _patientId;
            }
            set
            {
                _patientId = value;
                OnPropertyChanged(() => PatientId);
            }
        }

       public ObservableCollection<SiteSelectEntity> SiteEntityList
        {
            get
            {
                return _siteEntityList;
            }
            set
            {
                _siteEntityList = value;
                OnPropertyChanged(() => SiteEntityList);
            }
        } 
        [CheckValue("标本定义“采集人”不能为空")]
        public String Collecter
        {
            get
            {
                return _collecter;
            }
            set
            {
                _collecter = value;
                OnPropertyChanged(() => Collecter);
            }
        }
       
        [CheckValue("标本定义“采集时间”不能为空")]
        public DateTime FollowUpDate
        {
            get
            {
                return _followUpDate;
            }
            set
            {
                _followUpDate = value;
                OnPropertyChanged(() => FollowUpDate);
            }
        }
        [CheckValue("标本定义“标本类型”不能为空")]
        public String SpecType
        {
            get
            {
                return _specType;
            }
            set
            {
                _specType = value;
                OnPropertyChanged(() => SpecType);
            }
        }
        
       /* public int FreezeThrawTimes
        {
            get
            {
                return _freezeThrawTimes;
            }
            set
            {
                _freezeThrawTimes = value;
                OnPropertyChanged(() => FreezeThrawTimes);
            }
        }  */
        public int MaxFreezeThrawTimes
        {
            get
            {
                return _maxFreezeThrawTimes;
            }
            set
            {
                _maxFreezeThrawTimes = value;
                OnPropertyChanged(() => MaxFreezeThrawTimes);
            }
        }
        public string SpecSource
        {
            get
            {
                return _specSource;
            }
            set
            {
                _specSource = value;
                OnPropertyChanged(() => SpecSource);
            }
        }
        
        

        public override void setValue(string key, Object value)
        {
            if (value is System.DBNull)
                return;
            switch (key.ToLower())
            {
                case "id":
                    this.Id = (string)value;
                    break;
                case "name":
                    this.Name = (string)value;
                    break;
                case "patientid":
                    this.PatientId = (string)value;
                    break;
                case "collecter":
                    this.Collecter = (string)value;
                    break;
                case "followuptimes":
                    this.FollowUpTimes = int.Parse(value.ToString());
                    break;
                case "followupdate":
                    this.FollowUpDate = (DateTime)value;
                    break;
                case "spectype":
                    this.SpecType = (string)value;
                    break;
                case "maxfreezethrawtimes":
                    this.MaxFreezeThrawTimes = int.Parse(value.ToString());
                    break;
               
                case "subject":
                    this.Subject = (string)value;
                    break;
                default:
                    break;
            }
        }
    }
}
